Skip to content

Conversation

manelmontilla
Copy link

@manelmontilla manelmontilla commented Aug 22, 2025

Add Support for SurrealDB .surql Migration Files

Overview

This PR adds support for embedding and processing SurrealDB .surql files in Refinery.

Motivation

We would like to implement a driver for SurrealDB, but it uses SurrealQL (.surql) as its query language. Currently Refinery only supports .sql and .rsfiles.
This change enables Refinery to recognize and process .surql migration files.

@manelmontilla manelmontilla marked this pull request as ready for review August 22, 2025 12:57
Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, and thanks for the interest!
If I understand correctly SurrealQL is a superset of SQL.

This PR only enables the support for SurrealQL extension, it doesn't support its data types and functions.
Can you elaborate on how would this help you support SurrealDB?

@manelmontilla
Copy link
Author

Hi, thanks for your reply!

SurrealQL isn’t a superset of SQL, it’s similar, but distinct.

As you mentioned, this PR only adds support for using .surql files. For us, it’s important to support the .surql extension so that editors like VS Code
can provide syntax highlighting.

We also plan to open-source a new driver for SurrealDB databases, following the approach recommended here, in any case, If you think it's better, I can open a PR directly in this repo to add the SurrealDB driver.

@jxs
Copy link
Member

jxs commented Oct 14, 2025

Thanks for elaborating.
Nah, I'd prefer if you host and maintain the SurrealDB driver. My qualms with this PR is that surql is a custom extension that only makes sense in the context of SurrealDB. If it's just for syntax highlighting I'd skip this, but if you require this for functioning I'd rather provide a method that allows parsing custom migration file extensions, wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants